<template>
	<view class="page" :style="{'min-height':h+'px','padding-top':mt+'px'}">
		<c-nav-bar title="提现"></c-nav-bar>
		<view class="account_money">
			<text>账户余额(元)</text>
			<text>{{(money||0).toFixed(2)}}</text>
		</view>
		<view class="topuo_money">
			<view class="tm_title">申请提现</view>
			<view class="tm_zdy">
				<text>￥</text>
				<input type="text" placeholder="请输入提现金额" placeholder-class="zdy_ph" v-model="txMoney" @blur="setTxMoney" @confirm="setTxMoney">
			</view>
			<view class="tm_tip">
				当前可提现金额{{money}}，<span @tap="txAll">全部提现</span>
			</view>
		</view>
		<view class="txfs">
			<view class="t_title">选择提现方式</view>
			<view class="t_wechat">
				<view class="tw_l">
					<image src="https://i.ringzle.com/file/20231221/d682d495898e438aa9c665e69b482ebc.png"></image>
					<text>提现至微信</text>
				</view>
				<image class="tw_r" src="https://i.ringzle.com/file/20240220/ab1b5e0ebe964bdca8b4a6230163e93d.png"></image>
			</view>
		</view>
		<view class="explain">
			<view class="e_title">提现说明</view>
			<view class="e_pre">1.若未绑定银行卡，请您先绑定一张支持提现的储蓄卡再进行提现操作。</view>
			<view class="e_pre">2.若提现进度显示处理中，人工无法加急请您耐心等待。</view>
		</view>
		<view class="bottom">
			<view class="btn" @tap="applyTx">申请提现</view>
		</view>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				h: uni.getSystemInfoSync().windowHeight,
				mt: uni.getSystemInfoSync().statusBarHeight + 44,
				money:0,
				txMoney:'',
				txShow:false
			}
		},
		onLoad(option) {
			this.money = +option.money||0;
		},
		methods: {
			setTxMoney(e){
				if(+this.txMoney>this.money) return this.$showToast('提现金额超出账户余额');
				this.txMoney = e.target.value;
			},
			txAll(){
				this.txMoney = this.money;
			},
			applyTx(){
				if(!this.txMoney) return this.$showToast('请输入提现金额');
				if(+this.txMoney>this.money) return this.$showToast('提现金额超出账户余额');
				this.$refs.uToast.show({
					type: 'success',
					title: '',
					message: "正在开发",
					iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
				})
			}
		}
	}
</script>

<style scoped lang="less">
	.page{
		width: 100%;
		padding: 0 30rpx 208rpx;
		box-sizing: border-box;
		overflow-y: auto;
		background: #ffffff;
		
		.account_money{
			width: 100%;
			height: 236rpx;
			padding: 0 42rpx;
			margin-top: 24rpx;
			box-sizing: border-box;
			background: url(https://i.ringzle.com/file/20231221/58dba6217f2e483b8fb5cf44d4f0f2ee.png) no-repeat;
			background-size: 100% 100%;
			display: flex;
			flex-direction: column;
			text{
				color: #9B4600;
				&:first-child{
					font-size: 32rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					margin-top: 48rpx;
				}
				&:last-child{
					font-size: 56rpx;
					font-family: D-DIN, D-DIN;
					font-weight: bold;
					margin-top: 36rpx;
				}
			}
		}
		
		.topuo_money{
			margin-top: 48rpx;
			.tm_title{
				font-size: 36rpx;
				font-family: PingFang-SC, PingFang-SC;
				font-weight: bold;
				color: #000000;
			}
			.tm_zdy{
				width: 100%;
				height: 120rpx;
				padding: 0 38rpx;
				box-sizing: border-box;
				background: #F5F8FA;
				border-radius: 12rpx;
				display: flex;
				align-items: center;
				margin-top: 30rpx;
				text{
					font-size: 48rpx;
					font-family: D-DIN, D-DIN;
					font-weight: bold;
					color: #333333;
				}
				input{
					height: 120rpx;
					margin-left: 24rpx;
					border: none;
					font-size: 48rpx;
					font-family: D-DIN, D-DIN;
					font-weight: bold;
					color: #333333;
				}
				::v-deep .zdy_ph{
					font-size: 32rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					color: #AAAAAA;
				}
			}
			.tm_tip{
				margin-top: 20rpx;
				font-size: 28rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #AAAAAA;
				span{
					color: #007A69;
					margin-left: 20rpx;
				}
			}
		}
		
		.txfs{
			margin-top: 72rpx;
			.t_title{
				font-size: 32rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #000000;
			}
			.t_wechat{
				margin-top: 58rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				.tw_l{
					display: flex;
					align-items: center;
					image{
						width: 48rpx;
						height: 48rpx;
					}
					text{
						font-size: 32rpx;
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						color: #000000;
						margin-left: 20rpx;
					}
				}
				.tw_r{
					width: 38rpx;
					height: 38rpx;
				}
			}
		}
		
		.explain{
			margin-top: 134rpx;
			.e_title{
				font-size: 26rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #000000;
				margin-bottom: 10rpx;
			}
			.e_pre{
				font-size: 26rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #808080;
				line-height: 44rpx;
			}
		}
		
		.bottom{
			width: 100%;
			height: 188rpx;
			position: fixed;
			bottom: 0;
			left: 0;
			background: #fff;
			z-index: 9;
			.btn{
				width: calc(100% - 48rpx);
				height: 88rpx;
				background: #E0B181;
				border-radius: 44rpx;
				margin: 20rpx 24rpx 0;
				text-align: center;
				line-height: 88rpx;
				font-size: 32rpx;
				font-family: PingFang-SC, PingFang-SC;
				font-weight: bold;
				color: #FFFFFF;
				letter-spacing: 2rpx;
			}
		}
	}
</style>